package com.cqemme.comm.po;

import com.cqemme.comm.utils.ResultCodeMsg;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

/**
 * @author nejery
 */

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class Result {

    private int statusCode = ResultCodeMsg.CODE_200;

    private String message;

    private Object data;

    private String error;


    /**获取当前是否有值 没有则设置默认*/
    public String getMessage() {
        if(StringUtils.isEmpty(message)) {
           message = ResultCodeMsg.getMsg(statusCode);
        }
        return message;
    }

}
